package com.messagers
{
	import flash.filesystem.File;
	import flash.utils.Dictionary;
	
	import starling.utils.AssetManager;
	import com.AppConfing;

	/**
	 * 加载通用的基本组件皮肤管理器
	 * @author shishujun
	 * 
	 */	
	public class AppLoadUIMessager
	{
		private static var baseUIdictionary : Object;
		private static var baseUIFile : File;
		private static var baseUIAssetManager : AssetManager;
		private static const BASEUIFILE_URL : String = "/assets/baseUI";	//	编辑器用图标文件夹路径
		private static var assetsLoadComplete : Function;
		
		public function AppLoadUIMessager()
		{
		}
		
		/**
		 * 加载通用的基本组件皮肤图片 
		 * @param loadComplete
		 * 
		 */		
		public static function loadbaseUIAssets(loadComplete : Function) : void
		{
			var str : String = AppConfing.SwfUrl + BASEUIFILE_URL;
			var f : File = new File(str);
			
			baseUIAssetManager = new AssetManager();
			baseUIAssetManager.enqueue(f);
			baseUIAssetManager.loadQueue(onprogress);
			
			assetsLoadComplete = loadComplete ;
		}
		
		/**
		 * 加载编辑器组件图标的文件夹资源。 
		 * @param ratio
		 * 
		 */		
		private static function onprogress(ratio:Number) : void
		{
			if(ratio == 1)
			{
				assetsLoadComplete(baseUIAssetManager);
			}
		}
	}
}